package DocCangAPI;

public class IndexOfDemo {
    public static void main(String[] args) {
        String name="Thinking in Java";

        int position=name.indexOf("in");
        System.out.println(position);//2
        position=name.indexOf("on");
        System.out.println(position);//-1

        int position2=name.indexOf('n',4);
        System.out.println(position2);//6
    }
}
